const getters = {
    token: state => state.user.token,
    avatarUrl:state => state.user.avatarUrl,
    nickName: state => state.user.nickName,
    addressInfo: state => state.address.addressInfo,
    cartLists: state => state.cart.cartLists,
    checkedCountNums: state => state.cart.cartLists.reduce((pre, item) => pre + (item.checked ? item.nums : 0), 0),
    checkedAllTotal: state => state.cart.cartLists.reduce((pre, item) => pre + (item.checked ? item.nums * item.goods_price : 0), 0),
    checkedGoodsList: state => state.cart.cartLists.filter(item => item.checked === true)
}

export default getters